from time import*


def sort_n(data):
    fl = 1
    while fla:
        fl = 0
        for i in range(len(data_n) - 1):
            if data_n[i] > data_n [i + 1]:
                data_n[i], data_n[i + 1] = data_n[i + 1], data_n[i]
                fl = 1


def read_f(file):
    data_n = [int(i) for i in open(file)]
    return data_n





def time_m(sr):
    step_1 = read_f(sr)
    time_start = time()
    sort_nums(step_1)
    time_finish = time()
    print(f'{sr} {int((time_finish - time_start) * 1000)} milliseconds')


time_m('m2_reverse.txt')
time_m("m1_sorted.txt")
